Imports System
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports DotNetNuke
Namespace NVPortal.Modules.NVProduct

    Public MustInherit Class SanPhamKhuyenMai
        Inherits Entities.Modules.PortalModuleBase

#Region "Controls"
#End Region

#Region "Event Handlers"
        Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Try
                If Not IsPostBack Then

                    Dim DisplayNumber As String
                    If Settings("ProductDisplayNumberSetting") <> "" Then
                        DisplayNumber = Settings("ProductDisplayNumberSetting")
                    Else
                        DisplayNumber = "1" ' 1 row and 1 col
                    End If

                    'Cac tin khac cung chuyen muc voi tin nay
                    Dim arrNews As New ArrayList
                    Dim ctlNews As New ProductController
                    arrNews = ctlNews.SelectOption(IIf(Settings("ProductCategorySetting") <> "", Settings("ProductCategorySetting"), 0), PortalId, Settings("ProductDisplayNumberSetting"), -1, True)
                    Me.rptSanpham.DataSource = arrNews
                    Me.rptSanpham.DataBind()
                End If
            Catch ex As Exception
                'Me.imgNews.Visible = False
                ' Exception
                ProcessModuleLoadException(Me, ex)
            End Try
        End Sub
        Public Function ReplaceChuoi(ByVal chuoi As String) As String
            Dim convert As String = Global.ReplaceChuoi.bodau(chuoi).Replace(" ", "-")
            Return convert
        End Function
        Public Function FormatURL(ByVal sitem As String, ByVal strLink As String) As String
            Dim tabshow As Integer
            tabshow = Settings("ProductDisplayPageSetting")
            Return "/" & tabshow & "/" & sitem & "/" & ReplaceChuoi(strLink) & ".aspx"
        End Function

#End Region

#Region "Optional Interfaces"

#End Region


    End Class

End Namespace
